Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request refactors the sign-out flow in FirebaseAuthUI to ensure that provider-side sessions (Google and Facebook) are cleared properly. Since auth.signOut() clears the current user, the linked providers are now captured from providerData beforehand. Additionally, the Facebook sign-out logic is guarded to handle cases where the Facebook SDK is not present at runtime. Feedback on these changes suggests avoiding catching Throwable in signOutFromFacebook to prevent swallowing critical JVM errors, recommending catching LinkageError and Exception separately instead.
demolaf
force-pushed
the
fix/signout-provider-sessions
branch
from
September 9, 2026 14:35
bca0e64 to
2404066
Compare
demolaf
force-pushed
the
fix/signout-provider-sessions
branch
from
September 16, 2026 10:53
2404066 to
96d0a39
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
FirebaseAuthUI.signOut()never cleared the provider-side session. Both provider logout helpers ran afterauth.signOut()had already clearedcurrentUser, and their guard testedFirebaseUser.providerId, which the SDK always reports as"firebase", so neither ever executed. A Google user's saved credential state survived sign-out, silently re-selecting the same account on the next sign-in instead of showing the picker, and a Facebook user was never logged out.signOut()now reads the linked providers fromproviderDatabefore signing out of Firebase, then clears each provider's session from the call site. The Facebook branch is additionally gated onProviderAvailability.IS_FACEBOOK_AVAILABLE, sincefacebook-loginiscompileOnlyandproviderDatacan carryfacebook.comfor an account linked on another platform. Both helpers lose their now-unreachable internal guard and unusedauthparameter;signOutFromGooglerethrowsCancellationExceptioninstead of swallowing it.Added two
FirebaseAuthUITestcases and the first e2e coverage ofFirebaseAuthUI.signOut(), verified to fail on the old code and pass with the fix. Three pre-existing tests stubbedmockUser.providerIdto values the real SDK never returns, which is what hid the bug; those stubs are gone.Maintainer note: Fixes internal CPRN-435